<TagAttribute("lens_flare","lens","????","????",2,240)>
Public Class LENS_FLARE_TAG
Inherits HaloTag
Public Const Extension as String = "lens_flare"
Public Const FourCC as String = "lens"
Public Const ParentFourCC as String = "????"
Public Const GrandParentFourCC as String = "????"
Public Const [Version] as Short = 2
Public Const HeaderLength as Integer = 240

''' <summary>
''' 
''' </summary>
#Region "lens flare"

''' <summary>
''' 
''' </summary>
<TagField("falloff angle:degrees", 1, 0)>
Public falloff_angle as Single

''' <summary>
''' 
''' </summary>
<TagField("cutoff angle:degrees", 1, 0)>
Public cutoff_angle as Single

''' <summary>
''' 
''' </summary>
<TagField("", 8, -1)>
Public padding as Byte()

''' <summary>
''' Occlusion factor affects overall lens flare brightness and can also affect scale. Occlusion never affects rotation.
''' </summary>
#End Region
#Region "occlusion"

''' <summary>
''' radius of the square used to test occlusion
''' </summary>
<TagField("occlusion radius:world units", 1, 0)>
Public occlusion_radius as Single

''' <summary>
''' 
''' </summary>
<TagField("occlusion offset direction", 1, 17)>
Public occlusion_offset_direction as Short

''' <summary>
''' 
''' </summary>
<TagField("", 2, -1)>
Public padding_1 as Byte()

''' <summary>
''' distance at which the lens flare brightness is maximum
''' </summary>
<TagField("near fade distance:world units", 1, 0)>
Public near_fade_distance as Single

''' <summary>
''' distance at which the lens flare brightness is minimum; set to zero to disable distance fading
''' </summary>
<TagField("far fade distance:world units", 1, 0)>
Public far_fade_distance as Single

''' <summary>
''' 
''' </summary>
#End Region
#Region "bitmaps"

''' <summary>
''' used by reflections
''' </summary>
<TagField("bitmap", 16, 10)>
Public bitmap as New TAG_REFERENCE

''' <summary>
''' 
''' </summary>
<TagField("flags", 1, 19)>
Public flags as Short

''' <summary>
''' 
''' </summary>
<TagField("", 2, -1)>
Public padding_2 as Byte()

''' <summary>
''' 
''' </summary>
<TagField("", 76, -1)>
Public padding_3 as Byte()

''' <summary>
''' Controls how corona rotation is affected by viewer and light angles.
''' </summary>
#End Region
#Region "corona rotation"

''' <summary>
''' 
''' </summary>
<TagField("rotation function", 1, 17)>
Public rotation_function as Short

''' <summary>
''' 
''' </summary>
<TagField("", 2, -1)>
Public padding_4 as Byte()

''' <summary>
''' 
''' </summary>
<TagField("rotation function scale:degrees", 1, 0)>
Public rotation_function_scale as Single

''' <summary>
''' 
''' </summary>
<TagField("", 24, -1)>
Public padding_5 as Byte()

''' <summary>
''' 
''' </summary>
#End Region
#Region "corona radius scale"

''' <summary>
''' amount to stretch the corona along the horizontal axis; 0 defaults to 1
''' </summary>
<TagField("horizontal scale", 1, 0)>
Public horizontal_scale as Single

''' <summary>
''' amount to stretch the corona along the vertical axis; 0 defaults to 1
''' </summary>
<TagField("vertical scale", 1, 0)>
Public vertical_scale as Single

''' <summary>
''' 
''' </summary>
<TagField("", 28, -1)>
Public padding_6 as Byte()

''' <summary>
''' lens_flare_reflection_block
''' </summary>
<TagField("reflections", 128, 11)>
Public reflections as List(Of REFLECTIONS_BLOCK)

''' <summary>
''' 
''' </summary>
<TagField("", 32, -1)>
Public padding_7 as Byte()
#End Region
Public Class REFLECTIONS_BLOCK

''' <summary>
''' 
''' </summary>
<TagField("flags", 1, 19)>
Public flags as Short

''' <summary>
''' 
''' </summary>
<TagField("", 2, -1)>
Public padding as Byte()

''' <summary>
''' 
''' </summary>
<TagField("bitmap index", 1, 23)>
Public bitmap_index as Short

''' <summary>
''' 
''' </summary>
<TagField("", 2, -1)>
Public padding_1 as Byte()

''' <summary>
''' 
''' </summary>
<TagField("", 20, -1)>
Public padding_2 as Byte()

''' <summary>
''' 0 is on top of light, 1 is opposite light, 0.5 is the center of the screen, etc.
''' </summary>
<TagField("position:along flare axis", 1, 0)>
Public position as Single

''' <summary>
''' 
''' </summary>
<TagField("rotation offset:degrees", 1, 0)>
Public rotation_offset as Single

''' <summary>
''' 
''' </summary>
<TagField("", 4, -1)>
Public padding_3 as Byte()

''' <summary>
''' interpolated by light scale
''' </summary>
<TagField("radius:world units", 2, 1)>
Public radius as Single()

''' <summary>
''' 
''' </summary>
<TagField("radius scaled by", 1, 17)>
Public radius_scaled_by as Short

''' <summary>
''' 
''' </summary>
<TagField("", 2, -1)>
Public padding_4 as Byte()

''' <summary>
''' interpolated by light scale
''' </summary>
<TagField("brightness:[0,1]", 2, 1)>
Public brightness as Single()

''' <summary>
''' 
''' </summary>
<TagField("brightness scaled by", 1, 17)>
Public brightness_scaled_by as Short

''' <summary>
''' 
''' </summary>
<TagField("", 2, -1)>
Public padding_5 as Byte()

''' <summary>
''' Tinting and modulating are not the same; 'tinting' a reflection will color the darker regions but leave the white highlights, while 
''' </summary>
#Region "tint color"

''' <summary>
''' if a=r=g=b=0 use light color instead; alpha blends between modulation and tinting
''' </summary>
<TagField("tint color", 4, 3)>
Public tint_color_1 as Single()

''' <summary>
''' Causes lens flare reflection to flicker, pulse, or whatever. Animated color modulates tint color, above, while animated alpha modulates brightness. Animation is ignored if tint color is BLACK or the animation function is ONE or ZERO.
''' </summary>
#End Region
#Region "animation"

''' <summary>
''' if a=r=g=b=0, default to a=r=g=b=1
''' </summary>
<TagField("color lower bound", 4, 3)>
Public color_lower_bound as Single()

''' <summary>
''' if a=r=g=b=0, default to a=r=g=b=1
''' </summary>
<TagField("color upper bound", 4, 3)>
Public color_upper_bound as Single()

''' <summary>
''' 
''' </summary>
<TagField("flags", 1, 19)>
Public flags_1 as Short

''' <summary>
''' 
''' </summary>
<TagField("animation function", 1, 17)>
Public animation_function as Short

''' <summary>
''' 0 defaults to 1
''' </summary>
<TagField("animation period:seconds", 1, 0)>
Public animation_period as Single

''' <summary>
''' 
''' </summary>
<TagField("animation phase:seconds", 1, 0)>
Public animation_phase as Single

''' <summary>
''' 
''' </summary>
<TagField("", 4, -1)>
Public padding_6 as Byte()
#End Region

End Class

End Class
